package models

import (
	"time"

	"go.mongodb.org/mongo-driver/bson/primitive"
)

// Article 文章模型
type Article struct {
	ID              primitive.ObjectID   `bson:"_id,omitempty" json:"id"`
	AuthorID        primitive.ObjectID   `bson:"authorId"       json:"authorId"`
	Title           string               `bson:"title"          json:"title"`
	Description     string               `bson:"description"    json:"description"`
	Content         string               `bson:"content"        json:"content"`
	Tags            []string             `bson:"tags"           json:"tags"`
	Status          string               `bson:"status"         json:"status"`     // pending/approved/rejected
	Visibility      string               `bson:"visibility"     json:"visibility"` // private/followers/public
	Likes           int                  `bson:"likes"          json:"likes"`
	Views           int                  `bson:"views"          json:"views"`
	Comments        []primitive.ObjectID `bson:"comments"       json:"comments"`
	CreatedAt       time.Time            `bson:"createdAt"      json:"createdAt"`
	UpdatedAt       time.Time            `bson:"updatedAt"      json:"updatedAt"`
	RejectionReason string               `bson:"rejectionReason,omitempty" json:"rejectionReason,omitempty"`
	CategoryID      primitive.ObjectID   `bson:"categoryId"    json:"categoryId"`
}
